package cn.sso.app.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaIgnore;
import cn.ifloat.brick.sprofile.web.common.BasicController;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author: float 2023/1/6 14:08
 */

@Controller
public class ResourceController extends BasicController {

    @SaCheckPermission("b.a")
    @RequestMapping("show1")
    public void show1(HttpServletResponse response) throws IOException {
        response.getWriter().print("show1");
    }

    @RequestMapping("show2")
    public void show2(HttpServletResponse response) throws IOException {
        response.getWriter().print("show2");
    }

    @RequestMapping("show3")
    @SaIgnore
    public void show3(HttpServletResponse response, HttpServletRequest request) throws IOException {
        String ru = request.getRemoteUser();
        String addr = request.getRemoteAddr();
        String host = request.getRemoteHost();

        response.getWriter().print("show3");
    }
}
